package com.igs.muziapp.view;

import java.util.ArrayList;
import java.util.HashMap;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.igs.muziapp.R;
import com.igs.muziapp.surface.IRequest_View;

public class Songinfo_table implements IRequest_View {
	// private View view;
	private Context context;
	private LinearLayout layout = null;

	private ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>();
	private SimpleAdapter adapter;
	private ListView LView;

	public Songinfo_table(Context context) {
		this.context = context;

		ViewGroup.LayoutParams param = new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
		layout = new LinearLayout(context);
		layout.setOrientation(LinearLayout.VERTICAL);
		layout.setLayoutParams(param);

		LView = new ListView(context);
		LView.setLayoutParams(param);

		String StrItem[] = { "TextName", "TextCondition", "TextRate", "ImageAch00" };

		int IntView[] = { R.id.textView_name, R.id.textView_condition, R.id.textView_rate, R.id.imageView_ach00 };

		for (int i = 0; i < 500; i++) {
			HashMap<String, Object> item = new HashMap<String, Object>();
			item.put(StrItem[0], "黑夜啟示錄_" + i);
			item.put(StrItem[1], "月份限定曲_" + i);
			item.put(StrItem[2], "-");
			item.put(StrItem[3], R.drawable.mb_app_p003_fcicon_001);
			list.add(item);
		}
		adapter = new SimpleAdapter(context, list, R.layout.muzi_songinfo_row0, StrItem, IntView);
		LView.setAdapter(adapter);


		//layout.setDrawingCacheEnabled(true);
		layout.addView(LView);

	}

	@Override
	public View getView() {
		// TODO Auto-generated method stub
		return layout;
	}

}
